<div class="dialog-container mdl-shadow--8dp mdl-layout--fixed-header SMES-dialog B0206-dialog" ng-init="init();"  style="background-color: #fafafa; ">
    <div class="kmi-header-row">
        <div class="header-title" ng-bind="'B0206.title' | translate" ng-show="dialog.mode=='trackOut'"></div>
        <div class="kmi-side-btn left" ng-click="dialog.backToTrackOut(dialog);" ng-hide="dialog.mode=='trackOut'">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="header-title" ng-bind="'B0206.badReason.title' | translate" ng-show="dialog.mode=='badReason'"></div>
        <div class="header-title" ng-bind="'B0206.multiple.multiple' | translate" ng-show="dialog.mode=='multiple'"></div>
        <div class="header-title" ng-bind="'B0206.production_inf.title' | translate" ng-show="dialog.mode=='production_inf'"></div>
        <div class="kmi-side-btn right" ng-click="dialog.trackOutBack();">
            <img src="image/icons/clear.png"></img>
            <div class="kmi-can-click"></div>
        </div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page" ng-show="dialog.mode=='trackOut'">
            <div style="display: flex;flex-direction: row;">
                <div style="flex:1;">
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.prodPatchNo' | translate"></label>
                        <label ng-bind="dialog.plotInfo.workstation_detail[0].plot_no" style="width:calc(50% - 108px); text-align: left;"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.trackOutNum' | translate"></label>
                        <input readonly="readonly" ng-click="dialog.trackOutInputQty($event, dialog.plotInfo.qty);" ng-model="dialog.plotInfo.qty">
                        <label ng-bind="'（'+dialog.plotInfo.workstation_detail[0].unit_no+'）'" ></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.good' | translate"></label>
                        <label class="value" ng-bind="dialog.plotInfo.good_qty"></label>
                        <label class="label" ng-bind="'B0206.trackOut.bad' | translate"></label>
                        <label class="value" ng-bind="dialog.plotInfo.total_abnormal_qty"></label>
                    </div>
                    <div class="kmi-text-fields" ng-if="dialog.showRuleYield()">
                        <label class="label" ng-bind="'B0206.trackOut.rule_yield_ls' | translate" ng-if="dialog.plotInfo.rule_yield_ls"></label>
                        <label ng-bind="dialog.plotInfo.rule_yield_ls+'%'" ng-if="dialog.plotInfo.rule_yield_ls" style="width:calc(50% - 108px); text-align: left;"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.product_no' | translate"></label>
                        <label ng-bind="dialog.plotInfo.product_no"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.op_no' | translate"></label>
                        <label ng-bind="dialog.plotInfo.workstation_detail[0].op_no"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.laborNum' | translate"></label>
                        <label class="value" ng-bind="dialog.plotInfo.workstation_detail[0].number_of_labor" style="padding-right: 4px;"></label>
                        <label class="label" ng-bind="'B0206.trackOut.laborHours' | translate" ng-show="dialog.parent=='B0214'"></label>
                        <input class="value" ng-show="dialog.parent=='B0214'" mdl-calculater="dialog.plotInfo.workstation_detail[0].labor_hours" mdl-calculater-decimal="true" style="min-width: 100px;margin-right:8px;    flex: 0 0 calc(50% - 85px);">
                    </div>
                </div>
                <div style="flex:1;">
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.wo_no' | translate"></label>
                        <label ng-bind="dialog.plotInfo.wo_no" style="width:calc(50% - 108px); text-align: left;"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.conversion_rate' | translate"></label>
                        <label class="value" ng-bind="dialog.plotInfo.workstation_detail[0].C_Numerator+'/'+dialog.plotInfo.workstation_detail[0].C_Denominator" style="flex: 0 0 calc(50% - 72px);"></label>
                        <label class="label" ng-bind="'B0206.trackOut.QTYACIO' | translate"></label>
                        <label class="value" ng-bind="dialog.plotInfo.workstation_detail[0].QTYACIO + '（'+dialog.plotInfo.workstation_detail[0].UNITACIO+'）'"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.lack' | translate"></label>
                        <label class="value" ng-bind="dialog.plotInfo.total_lack_qty" style="width:calc(50% - 54px);"></label>
                        <label class="label" ng-bind="'B0206.trackOut.surplus' | translate"></label>
                        <label class="value" ng-bind="dialog.plotInfo.total_surplus_qty"></label>
                    </div>
                    <div class="kmi-text-fields" ng-if="dialog.showRuleYield()">
                        <label class="label" ng-bind="'B0206.trackOut.rule_yield_lcl' | translate" ng-if="dialog.plotInfo.rule_yield_lcl"></label>
                        <label ng-bind="dialog.plotInfo.rule_yield_lcl+'%'" ng-if="dialog.plotInfo.rule_yield_lcl"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.product_name ' | translate"></label>
                        <label ng-bind="dialog.plotInfo.item_name"></label>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.op_name' | translate"></label>
                        <label ng-bind="dialog.plotInfo.workstation_detail[0].op_name" style="flex: 0 0 calc(50% - 108px);"></label>
                        <label class="label" ng-bind="'B0206.trackOut.machine_no_wip' | translate"></label>
                        <input ng-model="dialog.plotInfo.machine_no_wip"></input>
                        <div class="tip search"><i class="material-icons" ng-click="dialog.loadMachineList();">search</i></div>
                    </div>
                    <div class="kmi-text-fields">
                        <label class="label" ng-bind="'B0206.trackOut.totalLaborHours' | translate"></label>
                        <label ng-bind="dialog.plotInfo.workstation_detail[0].labor_hours" style="flex:1;padding-right: 4px;flex: 0 0 calc(50% - 103px);"></label>
                        <label class="label" ng-bind="'B0206.trackOut.machineHours' | translate"></label>
                        <input mdl-calculater="dialog.plotInfo.workstation_detail[0].machine_hours" mdl-calculater-decimal="true" style="min-width: 100px;flex:1;">
                    </div>
                </div>
            </div>
            <div class="kmi-list material-list" style="flex:1;padding:0px;">
                <div class="kmi-list__header">
                    <div class="kmi-list__column" style="width:200px" ng-bind="'B0206.trackOut.materialsNo' | translate"></div>
                    <div class="kmi-list__column" style="width:200px" ng-bind="'B0206.trackOut.materialsPatchNo' | translate"></div>
                    <div class="kmi-list__column" style="flex:2" ng-bind="'B0206.trackOut.unitStan' | translate"></div>
                    <div class="kmi-list__column" style="flex:2;" ng-bind="'B0206.trackOut.use' | translate"></div>
                    <div class="kmi-list__column" style="flex:1" ng-bind="'B0206.trackOut.unitNo_0' | translate"></div>
                </div>
                <div class="kmi-list__row-content">
                    <div class="kmi-list__row" ng-repeat="item in dialog.plotInfo.workstation_detail[0].materials_detail track by $index">
                        <div class="kmi-list__column column-border" style="width:200px" ng-bind="item.materials_no"></div>
                        <div class="kmi-list__column column-border" style="width:200px" ng-bind="item.materials_plot_no"></div>
                        <div class="kmi-list__column column-border" style="flex:2" ng-bind="item.std_use_qty"></div>
                        <div class="kmi-list__column column-border column-input" style="flex:2" ng-if="item.putinplace_type == 5" ng-bind="item.use_qty"></div>
                        <div class="kmi-list__column column-border column-input" style="flex:2" ng-if="item.putinplace_type != 5">
                            <input mdl-calculater="item.use_qty" mdl-calculater-decimal-length="6" mdl-calculater-title="{{'B0206.calculater-title'|translate}}">
                        </div>
                        <div class="kmi-list__column" style="flex:1" ng-bind="item.materials_unit"></div>
                    </div>
                </div>
            </div>
            <div class="btn-panel">
                <div style="display: flex">
                    <div class="kmi-button kmi-button-confrim btn-confirm" style="width:150px"   ng-click="dialog.openBadPage()">
                        <label ng-bind="'B0206.badReason.title' | translate"></label>
                        <div class="kmi-can-click"></div>
                    </div>
                    <div class="kmi-button kmi-button-confrim "  style="width:150px" ng-click="dialog.openMultiplePage()" ng-if="dialog.parent != 'B0214'">
                        <label ng-bind="'B0206.multiple.multiple' | translate"></label>
                        <div class="kmi-can-click"></div>
                    </div>
                    <div class="kmi-button kmi-button-confrim " ng-disabled="dialog.plotInfo.production_inf_type == '0'"
                        ng-class="{'is-require':dialog.isRequire}" style="width:150px">
                        <label ng-bind="'B0206.production_inf.title' | translate"></label>
                        <div class="kmi-can-click" ng-click="dialog.openProductionInfPage()"></div>
                    </div>
                </div>
                <div style="display:flex;">
                    <div class="kmi-button kmi-button-confrim btn-confirm" style="width:100px" ng-click="dialog.trackOutConfirm()">
                        <label ng-bind="'B0206.confirm' | translate"></label>
                        <div class="kmi-can-click"></div>
                    </div>
                    <!--
                    <div class="kmi-button kmi-button-cancel" style="width:100px" ng-click="dialog.trackOutBack()">
                        <label ng-bind="'common.btn.close' | translate"></label>
                        <div class="kmi-can-click" ></div>
                    </div>
                    -->
                </div>
            </div>
        </div>
        <!---不良原因---->
        <div class="kmi-layout-page" ng-show="dialog.mode=='badReason'">
            <div class="kmi-text-fields">
                <label class="label" ng-bind="'B0206.badReason.prodPatchNo'|translate"></label>
                <label style="flex:1;" ng-bind="dialog.plotInfo.workstation_detail[0].plot_no"></label>
                <label class="label" ng-bind="'B0206.badReason.badReasonType' | translate" style="flex: 0 0 156px;text-align: right;"></label>
                <input ng-model="dialog.tmpBadTypeName" ng-click="dialog.loadBadTypeList()" readonly="readonly" style="margin-right: 36px;">
                <div class="tip" style="right: 64px;"><i class="material-icons">&#xE5CF;</i></div>
            </div>
            <div class="kmi-text-fields" ng-show="dialog.mode=='badReason'">
                <label class="label" ng-bind="'B0206.badReason.badReason' | translate"></label>
                <input ng-model="dialog.tmpBadReason.reason_name" ng-click="dialog.loadBadReasonList()" readonly="readonly">
                <div class="tip"><i class="material-icons">&#xE5CF;</i></div>
                <label class="label" ng-bind="'B0206.badReason.badQty' | translate" style="width:150px; text-align:right"></label>
                <input mdl-calculater="dialog.tmpAbnormal_qty" mdl-calculater-decimal="true" style="margin-right:4px;">
                <button class="mdl-button mdl-js-button mdl-button--icon mdl-button--icon_prime" ng-click="dialog.addBadReason()">
                    <img src="image/icons/add.png"></img>
                </button>
            </div>
            <div class="kmi-list">
                <div class="kmi-list__header">
                    <!-- <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.trackOut.prodPatchNo1' | translate" ></div> -->
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.badReason.reason_type' | translate" ></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.badReason.reason' | translate" ></div>
                    <div class="kmi-list__column" style="flex:0 0 104px;" ng-bind="'B0206.badReason.badNo' | translate" ></div>
                    <div class="kmi-list__column" style="flex:0 0 104px;" ng-bind="'B0206.badReason.badQty_0' | translate" ></div>
                    <div class="kmi-list__column" style="flex:0 0 32px;"></div>
                </div>
                <div class="kmi-list__row-content">
                    <div class="kmi-list__row" ng-repeat="item in dialog.badReasonInfo track by $index">
                        <!-- <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.plot_no"></div> -->
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.abnormal_type_name"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.abnormal_name"></div>
                        <div class="kmi-list__column column-border" style="flex:0 0 104px;" ng-bind="item.abnormal_no"></div>
                        <div class="kmi-list__column" style="flex:0 0 104px;" ng-bind="item.defect_qty"></div>
                        <div class="kmi-list__column" style="flex:0 0 32px;">
                            <button class="mdl-button mdl-js-button mdl-button--icon" ng-click="dialog.removeBadReason(item)">
                                <img  src="image/icons/delete1.png"></img>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="search-tool">
                <div class="kmi-button kmi-button-confrim btn-confirm" ng-click="dialog.badReasonConfirm()"  style="width:100px">
                    <label ng-bind="'B0206.confirm' | translate"></label>
                    <div class="kmi-can-click" ></div>
                </div>
                <!--
                <div class="kmi-button kmi-button-cancel"   ng-click="dialog.badReasonCancel(dialog)" style="width:100px">
                    <label ng-bind="'common.btn.close' | translate"></label>
                    <div class="kmi-can-click"></div>
                </div>
                -->
            </div>
        </div>
        <!---多人產量---->
        <div class="kmi-layout-page" ng-show="dialog.mode=='multiple'">
            <div class="kmi-text-fields">
                <label class="label" ng-bind="'B0206.multiple.tmpLabor_no' | translate"></label>
                <input class="value" id="tmpLabor_no" ng-model="dialog.tmpLabor_no" ng-keypress="dialog.searchLabor($event);"></input>
                <div class="tip search" ng-click="dialog.searchLabor();"><img src="image/icons/search.png"></img> </div>
            </div>
            <div class="kmi-list">
                <div class="kmi-list__header">
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.multiple.laborNo' | translate" ></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.multiple.laborName' | translate" ></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.multiple.qty' | translate" ></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.multiple.labor_time' | translate" ></div>
                    <div class="kmi-list__column" style="flex:0 0 40px;" ></div>
                </div>
                <div class="kmi-list__row-content">
                    <div class="kmi-list__row" ng-repeat="labor in dialog.plotInfo.workstation_detail[0].labor_detail track by $index">
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="labor.labor_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="labor.labor_name"></div>
                        <div class="kmi-list__column column-border column-input" style="flex:1" >
                            <input readonly="readonly" ng-click="dialog.laborInputQty($event, labor);" ng-model="labor.qty">
                        </div>
                        <div class="kmi-list__column column-input" style="flex:1" >
                            <input readonly="readonly" mdl-calculater="labor.labor_time" mdl-calculater-decimal="true">
                        </div>
                        <div class="kmi-list__column" style="flex:0 0 40px;">
                            <button class="mdl-button mdl-button--icon" ng-click="dialog.deleteMultipleLabor(labor);">
                                <img src="image/icons/delete.png"></img>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="search-tool">
                <div class="kmi-button kmi-button-confrim btn-confirm" ng-click="dialog.multipleConfirm()"  style="width:100px">
                    <label ng-bind="'B0206.confirm' | translate"></label>
                    <div class="kmi-can-click" ></div>
                </div>
            </div>
        </div>
        <!--生產資訊收集-->
        <div class="kmi-layout-page" ng-show="dialog.mode=='production_inf'">
            <div class="kmi-text-fields">
                <label class="label" ng-bind="'B0206.trackOut.prodPatchNo'|translate"></label>
                <label class="value" ng-bind="dialog.plotInfo.workstation_detail[0].plot_no"></label>
                <label class="label" ng-bind="'B0206.production_inf.op_no'|translate"></label>
                <label class="value" ng-bind="dialog.plotInfo.workstation_detail[0].op_no"></label>
            </div>
            <div class="kmi-list">
                <div class="kmi-list__header">
                    <!-- <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.trackOut.prodPatchNo1' | translate" ></div> -->
                    <div class="kmi-list__column" style="flex:0 0 32px;"></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column1' | translate" ></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column2' | translate" ></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column3' | translate" ></div>
                    <div class="kmi-list__column" style="flex:1;" ng-bind="'B0206.production_inf.list.column4' | translate" ></div>
                </div>
                <div class="kmi-list__row-content">
                    <div class="kmi-list__row" ng-repeat="item in dialog.production_inf_detail track by $index">
                        <div class="kmi-list__column column-border" style="flex:0 0 32px;" ng-bind="$index+1"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.productioninf_no"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.productioninf_name"></div>
                        <div class="kmi-list__column column-border" style="flex:1;" ng-bind="item.description"></div>
                        <div class="kmi-list__column  column-input" style="flex:1;">
                            <input ng-if="item.method =='1'" ng-model="item.productioninf_value"/>
                            <div ng-if="item.method =='2'" class="check-point-switch" ng-class="{'is-selected':item.productioninf_value == '1'}"
                                ng-click="dialog.switchClick(item);" ng-init='dialog.switchInit(item);'>
                                <div style="width:24px;height:24px;"></div>
                            </div>
                            <input ng-if="item.method =='3'" mdl-calculater="item.productioninf_value" mdl-calculater-decimal="true">
                        </div>
                    </div>
                </div>
            </div>
            <div class="search-tool">
                <div class="kmi-button kmi-button-confrim btn-confirm" ng-click="dialog.productionInfConfirm()"  style="width:100px">
                    <label ng-bind="'B0206.confirm' | translate"></label>
                    <div class="kmi-can-click" ></div>
                </div>
            </div>
        </div>
    </div>
</div>
